//
//  ViewController.m
//  30103
//
//  Created by student on 16/3/17.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *imageview;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    NSMutableArray *marr=[[NSMutableArray alloc]init];
    UIImage *image=[UIImage imageNamed:@"chara1"];
    [marr addObject:image];
    UIImage *image2=[UIImage imageNamed:@"chara2"];
    [marr addObject:image2];
    self.imageview.animationImages=marr;
    self.imageview.animationDuration=0.5;
    [self.imageview startAnimating];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    UITouch *touch=[touches anyObject];
    CGPoint curpoint=[touch locationInView:self.view];
    self.imageview.center=curpoint;
}
@end
